package com.orhon.smartcampus.modules.student.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import com.orhon.smartcampus.modules.base.entity.Schools;
import com.orhon.smartcampus.modules.user.entity.Users;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
@EqualsAndHashCode
@Entity
@Table(name = "student_learninfo", schema = "smartcloud", catalog = "")
public class Learninfo {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;
    
    @Column(name = "at_school", nullable = true)
    private Integer atSchool;
    
    @Column(name = "transaction_type", nullable = true, length = 255)
    private String transactionType;
    
    @Column(name = "membership_number", nullable = true, length = 12)
    private String membershipNumber;
    
    @Column(name = "class_code", nullable = true, length = 50)
    private String classCode;
    
    @Column(name = "start_year", nullable = true)
    private String startYear;
    
    @Column(name = "finished_year", nullable = true)
    private String finishedYear;
    
    @Column(name = "admission_method", nullable = true, length = 11)
    private String admissionMethod;
    
    @Column(name = "way_to_study", nullable = true)
    private Integer wayToStudy;
    
    @Column(name = "way_to_annex", nullable = true, length = -1)
    private String wayToAnnex;
    
    @Column(name = "student_from", nullable = true, length = 11)
    private String studentFrom;
    
    @Column(name = "confirmed", nullable = true)
    private Integer confirmed;
    
    @Column(name = "confirmed_by", nullable = true, length = 255)
    private String confirmedBy;
    
    @Column(name = "created_at", nullable = true)
    private Date createdAt;
    
    @Column(name = "updated_at", nullable = true)
    private Date updatedAt;
    
    @Column(name = "deleted_at", nullable = true)
    private Date deletedAt;


    @ManyToOne
    @JoinColumn(name = "user_id", referencedColumnName = "id")
    @Where(clause = "ISNULL(deleted_at)")
    @NotFound(action=NotFoundAction.IGNORE)
    private Users userUsersByUserId;

    @ManyToOne
    @JoinColumn(name = "student_id", referencedColumnName = "id")
    @Where(clause = "ISNULL(deleted_at)")
    @NotFound(action=NotFoundAction.IGNORE)
    private SInformation studentSInformationByStudentId;

    @ManyToOne
    @JoinColumn(name = "school_id", referencedColumnName = "id")
    @Where(clause = "ISNULL(deleted_at)")
    @NotFound(action=NotFoundAction.IGNORE)
    private Schools baseSchoolsBySchoolId;

    @ManyToOne
    @JoinColumn(name = "arrive_id", referencedColumnName = "id")
    @Where(clause = "ISNULL(deleted_at)")
    @NotFound(action=NotFoundAction.IGNORE)
    private Arrives studentArrivesByArriveId;
}
